package com.project.restaurant.order.enums;

public enum OrderState {


    /**
     * 订单取消
     */
    CANCEL_PAY(-1),
    /**
     * 待支付
     */
    WAITING_PAY(0),

    /**
     * 已支付
     */
    ALREADY_PAY(1),

    /**
     * 待评价
     */
    WAITING_EVALUATE(2),

    /**
     * 已评价
     */
    ALREADY_EVALUATE(3)
    ;

    private int orderState;

    OrderState(int orderState){
        this.orderState = orderState;
    }

    public static OrderState getOrderState(int orderState){
        OrderState[] values = OrderState.values();
        for(OrderState v:values){
            if(v.getOrderState()==orderState){
                return v;
            }
        }
        return null;
    }

    public int getOrderState() {
        return orderState;
    }
}
